package com.lhkj.ct.base.model;

import com.lhkj.ct.base.enums.DataScope;
import com.lhkj.ct.base.enums.DeleteStatus;
import com.lhkj.ct.base.enums.GlobalStatus;

import java.util.HashSet;
import java.util.Set;

/**
 * 用户认证信息(用做登录时查询数据库)
 *
 * @author haoxr
 * @since 2022/10/22
 *
 */
public class UserAuthInfo {

    /**
     * 用户id
     */
    private String userId;

    /**
     * 用户类型 1.后台人员 2.平台用户
     */
    private Integer userType;

    /**
     * 账号
     */
    private String username;

    /**
     * 用户名
     */
    private String name;

    /**
     * 科室id
     */
    private String deptId;

    /**
     * 科室id
     */
    private String organId;

    /**
     * 密码
     */
    private String password;

    /**
     * 用户状态（0.正常 1.禁用）
     */
    private GlobalStatus status;

    /**
     * 用户状态（0.正常 1.禁用）
     */
    private GlobalStatus orgStatus;

    /**
     * 用户状态（0.正常 1.禁用）
     */
    private DeleteStatus orgDelFlag;

    /**
     * shiro的用户角色
     */
    private Set<String> shiroRoles;

    /**
     * 系统内角色编码
     */
    private Set<String> roles;

    /**
     * 系统内角色id
     */
    private Set<String> roleIds;

    /**
     * 系统内权限
     */
    private Set<String> perms;

    /**
     * 数据权限
     */
    @Deprecated
    private DataScope dataScope;

    public void addShiroRole(String role) {
        if (null == shiroRoles){
            shiroRoles = new HashSet<>();
        }
        shiroRoles.add(role);
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    public String getOrganId() {
        return organId;
    }

    public void setOrganId(String organId) {
        this.organId = organId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public GlobalStatus getStatus() {
        return status;
    }

    public void setStatus(GlobalStatus status) {
        this.status = status;
    }

    public GlobalStatus getOrgStatus() {
        return orgStatus;
    }

    public void setOrgStatus(GlobalStatus orgStatus) {
        this.orgStatus = orgStatus;
    }

    public DeleteStatus getOrgDelFlag() {
        return orgDelFlag;
    }

    public void setOrgDelFlag(DeleteStatus orgDelFlag) {
        this.orgDelFlag = orgDelFlag;
    }

    public Set<String> getShiroRoles() {
        return shiroRoles;
    }

    public void setShiroRoles(Set<String> shiroRoles) {
        this.shiroRoles = shiroRoles;
    }

    public Set<String> getRoles() {
        return roles;
    }

    public void setRoles(Set<String> roles) {
        this.roles = roles;
    }

    public Set<String> getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(Set<String> roleIds) {
        this.roleIds = roleIds;
    }

    public Set<String> getPerms() {
        return perms;
    }

    public void setPerms(Set<String> perms) {
        this.perms = perms;
    }

    public DataScope getDataScope() {
        return dataScope;
    }

    public void setDataScope(DataScope dataScope) {
        this.dataScope = dataScope;
    }
}
